home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / AList.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.8 KB  |  89 lines

  1. /* AttachedList example */
  2.  
  3. call Init
  4. call createApp
  5. call handleApp()
  6. /* never reached */
  7. /***********************************************************************/
  8. init: procedure
  9.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  10.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  11.     return
  12. /***********************************************************************/
  13. createApp: procedure
  14.     app.Title="AttachedListExample"
  15.     app.Version="$VER: AttachedListExample 1.0 (8.7.2001)"
  16.     app.Copyright="©2001 by Alfonso Ranieri"
  17.     app.Author="Alfonso Ranieri"
  18.     app.Description="AttachedList Example"
  19.     app.Base="ALIST"
  20.     app.SubWindow="mwin"
  21.      mwin.Title="AttachedList Example"
  22.      mwin.ID="MWIN"
  23.      mwin.Contents="mgroup"
  24.       mgroup.0="lv"
  25.        lv.class="Listview"
  26.        l.format="COL=0 BAR,COL=1"
  27.        l.acyclechain=1
  28.        lv.list="l"
  29.         l.0="Alfonso|337665323"
  30.         l.1="Paolo|32898765"
  31.         l.2="Emi|338299222"
  32.       mgroup.1="g"
  33.        g.class="group"
  34.        g.horiz=1
  35.          sort.acyclechain=1
  36.         g.0=Button("sort","_Sort")
  37.          add.acyclechain=1
  38.         g.1=Button("add","_Add")
  39.          remove.acyclechain=1
  40.         g.2=Button("remove","_Remove")
  41.       mgroup.2="sg"
  42.        sg.class="group"
  43.        sg.horiz=1
  44.          sa.acyclechain=1
  45.          sa.reject="|"
  46.         sg.0=String("sa")
  47.          sb.acyclechain=1
  48.          sb.reject="|"
  49.         sg.1=String("sb")
  50.  
  51.     if NewObj("application","app")~=0 then exit
  52.  
  53.     call Notify("mwin","closerequest",1,"app","returnid","quit")
  54.  
  55.     call Notify("sort","pressed",0,"lv","sort")
  56.  
  57.     call Notify("add","pressed",0,"lv","insert","","bottom")
  58.     call Notify("add","pressed",0,"lv","set","active","bottom")
  59.  
  60.     call Notify("remove","pressed",0,"lv","remove","active")
  61.  
  62.     call Notify("lv","active",-1,"sa","set","contents","")
  63.     call Notify("lv","active",-1,"sb","set","contents","")
  64.     call Notify("lv","activeentry0","everytime","sa","set","contents","triggervalue")
  65.     call Notify("lv","activeentry1","everytime","sb","set","contents","triggervalue")
  66.     call Notify("lv","doubleclick","everytime","app","return","say double")
  67.  
  68.     call Notify("sa","newcontents","everytime","lv","replacecol","active",0,"triggervalue")
  69.     call Notify("sb","newcontents","everytime","lv","replacecol","active",1,"triggervalue")
  70.  
  71.     call set("sa","AttachedList","lv")
  72.     call set("sb","AttachedList","lv")
  73.  
  74.     call set("mwin","defaultobject","lv")
  75.     call set("mwin","open",1)
  76.  
  77.     return
  78. /***********************************************************************/
  79. handleApp: procedure
  80.     ctrl_c=2**12
  81.     do forever
  82.         call NewHandle("app","h",ctrl_c)
  83.         if h.event="QUIT" then exit
  84.         else interpret h.event
  85.     end
  86. /* never reached */
  87. /***********************************************************************/
  88.  
  89.